# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Josip Ponjavic <josipponjavic at gmail dot com>
# Contributor: Xu Fasheng <fasheng.xu[AT]gmail.com>

pkgname=deepin-terminal-gtk
pkgver=5.0.4.3
pkgrel=1
pkgdesc='Default terminal emulation application for Deepin, the old gtk version'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/deepin-terminal-gtk"
license=('GPL3')
depends=('vte3' 'libsecret' 'libgee' 'libwnck3' 'expect')
makedepends=('cmake' 'ninja' 'vala')
optdepends=('deepin-menu: for native menu integration under DDE'
            'zssh: for remote management support')
conflicts=('deepin-terminal' 'deepin-terminal-old')
provides=('deepin-terminal' 'deepin-terminal-old')
replaces=('deepin-terminal-old')
source=("https://github.com/linuxdeepin/deepin-terminal-gtk/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('4da67877cf571781fd708bc740e23f0178ef2a93d4d13a6935857d2577dc0a5a58dc77db2bbc60760cba470548b7e72598d105acef7c7486b5dfea5766b510a9')

prepare() {
  mkdir -p build
}

build() {
  cd build
  cmake -GNinja \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DTEST_BUILD=OFF \
    -DUSE_VENDOR_LIB=OFF \
    -DVERSION=$pkgver \
    ../deepin-terminal-gtk-$pkgver
  ninja
}

package() {
  cd build
  DESTDIR="$pkgdir" ninja install
  ln -s deepin-terminal "$pkgdir"/usr/bin/x-terminal-emulator
}
